﻿//10.Write a program that converts a string to a sequence of C# Unicode character literals. Use format strings.
//Sample input: Hi! Expected output: \u0048\u0069\u0021

using System;

namespace ConvertToUnicode
{
    class ConvertToUnicode
    {
        static void Main()
        {
            Console.Write("Enter a string: ");
            string text = Console.ReadLine();

            char[] newtext = text.ToCharArray(0, text.Length);
            int[] valuetext = new int[text.Length];
            string[] hexOutput = new string[text.Length];

            for (int i = 0; i <= newtext.Length - 1; i++)
            {
                valuetext[i] = Convert.ToInt32(newtext[i]);
                hexOutput[i] = valuetext[i].ToString("X4");
                Console.Write("\\u{0}", hexOutput[i]);
            }
            Console.WriteLine();
        }
    }
}
